package com.zyc.studentstudy.utils

import android.content.Context
import android.net.ConnectivityManager

/**
 * Description :
 * Author : mhwang
 * Date : 2017/5/27
 * Version : V1.0
 */

object NetWorkUtil {

    /** 判断网络是否连接
     * @param context
     * @return
     */
    @JvmStatic
    fun isNetworkAvailible(context: Context): Boolean {
        val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager
        val networkInfo = connectivityManager?.activeNetworkInfo
        return networkInfo?.isAvailable == true
    }
}
